<% 
<!-- Raw data process-->
    var tweetClass = "";
    switch (refav){
        case "1" : tweetClass = "retweeted";
            break;
        case "10" : tweetClass = "favorited";
            break;
        case "11" : tweetClass = "retweeted favorited";
            break
    }
    var myTweet = false;
    if ( currentUserID == user_id){
        myTweet = true;
        tweetClass += " my-tweet";
    }
    
    <!-- Check if have image in post -->
    var isHaveImg = false;
    if ( content.match("http://?.*\w*\.(jpg|jpeg|png|gif)")){
        isHaveImg = true;
    }
        
    
    <!-- format date -->
    var reggie = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/g;
    var dateArray = reggie.exec(created_time); 
    var dateObject = new Date(
        (+dateArray[1]),
        (+dateArray[2])-1, // Careful, month starts at 0!
        (+dateArray[3]),
        (+dateArray[4]),
        (+dateArray[5]),
        (+dateArray[6])
    );
    reggie.lastIndex = 0;

%>
<div class="stream-item" id="<%= tweet_id%>">
    <div class="tweet <%= tweetClass%>">
        <i class="dogear"></i>
        <div class="content">
            <div class="stream-item-header">
                <small class="time">
                    <a class="tweet-timestamp" href="/twitter/tweet/detail?tweet_id=423"><span title="<%= dateObject.toISOString()%>" class="_timestamp">2h</span></a>
                </small>
                <a href="<%= SERVER_URL+"user/"+username%>" class="account-group">
                    <img alt="Books for experts" src="<%= avatar%>" class="avatar">
                    <strong class="fullname"><%= full_name %></strong>
                    <span>&rlm;</span><span class="username"><s>@</s><b><%= username%></b></span>
                </a>
            </div>
            <p>
                <!-- Content here -->
                <%= content %>
            </p>
            <div class="stream-item-footer">
                <div class="context">
                    <% if (retweeted_by != "") {%>
                    <span class="with-icn">
                        <i class="badge-retweeted"></i>
                        <span class="js-retweet-text">Retweeted by 
                            <a class="pretty-link" href="luckymancvp" data-user-id="83644624">
                                <b>Dang Thanh Tu</b>
                            </a>
                        </span>
                    </span>
                    <%}%>
                </div>
                <div class="details with-icn">
                    <% if (!isHaveImg) {%>
                        <span class="details-icon">
                        </span>
                        <b>
                            <span class="expand-stream-item">
                                <span class="expand-action-wrapper">
                                    Expand
                                </span>
                            </span>
                            <span class="collapse-stream-item">
                                <span class="collapse-action-wrapper">
                                    Collapse
                                </span>
                            </span>
                        </b>
                    <% }else{%>
                        <span class="details-icon">
                            <i data-media-type="photo" data-media-class="photo" class="sm-image"></i>
                        </span>
                        <b>
                            <span class="expand-stream-item">View photo</span>
                            <span class="collapse-stream-item">Hide photo</span>
                        </b>
                    <% }%>
                </div>
                <ul class="tweet-actions">
                    <li class="action-reply-container">

                        <a title="Reply" href="#" data-modal="tweet-reply" class="with-icn">
                            <i class="sm-reply"></i>
                            <b>Reply</b>
                        </a>
                    </li>
                    <% if (currentUserID != user_id){%>
                    <li class="action-rt-container">
                            <a href="#" data-modal="tweet-retweet" class="with-icn">
                                <i class="sm-rt"></i>
                                <b><span title="Undo retweet" class="undo-retweet">Retweeted</span><span title="Retweet" class="retweet">Retweet</span></b>
                            </a>
                        </li>
                    <% }else{ %>
                        <li class="action-del-container">
                            <a title="Delete" href="#" class="with-icn">
                                <i class="sm-trash"></i>
                                <b>Delete</b>
                            </a>
                        </li>
                    <% }%>
                    <li class="action-fav-container">
                        <a class="with-icn">
                            <i class="sm-fav"></i>
                            <b>
                                <span title="Undo favorite" class="unfavorite">Favorited</span>
                                <span title="Favorite" class="favorite">Favorite</span>
                            </b>
                        </a>
                    </li>
                </ul>      </div>
            <div class="expanded-content">
            </div>
        </div>
    </div>
</div>